package main

import (
	"fmt"
	"unsafe"
)

// 通过使用 unsafe 包中的方法来测试你电脑上一个整型变量占用多少个字节

func main() {
	var i int8
	var k int
	var u int32
	var o int64
	i, u = 2, 10
	size := unsafe.Sizeof(i)
	sizeK := unsafe.Sizeof(k)
	sizeU := unsafe.Sizeof(u)
	sizeO := unsafe.Sizeof(o)

	fmt.Println("The int8 size in you system is: ", size)
	fmt.Println("The int size in you system is: ", sizeK)
	fmt.Println("The int32 size in you system is: ", sizeU)
	fmt.Println("The int64 size in you system is: ", sizeO)
}
